package memory

type Memory struct {
	data map[interface{}]interface{}
}

func (m *Memory) Initialize() {
	m.data = make(map[interface{}]interface{})
}

func (m *Memory) Insert(key interface{}, data interface{}) {
	m.data[key] = data
}

func (m *Memory) Remove(key interface{}) {
	delete(m.data, key)
}

func (m *Memory) Inspect(key interface{}) (interface{}, bool) {
	val, ok := m.data[key]

	if !ok {
		return nil, false
	}
	return val, true
}
